

<template>
  <div v-if="show">
    <h2>ChildOne - ChildOne - 1  </h2>
    <h2>num == {{ num }}</h2>
    <h2>count == {{ count }} </h2>
    <h2>word = {{ obj.word  }}</h2>
    <h2>test = {{ test  }}</h2>

  </div>
</template>


<script>
export default {
  data(){
    return {
        count:2000,
        show:true
    }
  },
  inject:['obj','test'],
  methods:{
    changeShow(){
      this.show = !this.show;
    }
  },
  props:{
    num:Number,
  },
  mounted(){
    this.$bus.$on('changeonecount',n=>{
      this.count += n;
    })

    this.$bus.$on('changeshow',()=>{
      this.show = !this.show;
    })
  }
}
</script>
